import 'package:finance_app/src/entities/plans_subscription_entity.dart';
import 'package:finance_app/src/entities/plans_top_content_entity.dart';
import 'package:finance_app/src/page/setting/subscription/sub_payment_page.dart';

plansSubscriptionEntityFromJson(PlansSubscriptionEntity data, Map<String, dynamic> json) {
	if (json['top_contents'] != null) {
		data.topContents = (json['top_contents'] as List).map((v) => PlansTopContentEntity().fromJson(v)).toList();
	}
	if (json['plans'] != null) {
		data.plans = (json['plans'] as List).map((v) => PlansItemEntity().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> plansSubscriptionEntityToJson(PlansSubscriptionEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['top_contents'] =  entity.topContents?.map((v) => v.toJson())?.toList();
	data['plans'] =  entity.plans?.map((v) => v.toJson())?.toList();
	return data;
}